﻿using IOP.Pulsar.Abstractions;
using IOP.Pulsar.Default;
using IOP.Pulsar.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace RawSocketIntegrationTest
{
    public class Startup : IStartup
    {
        public void Configure(IServerBuilder server, IHostEnvironment env)
        {
            server.BuildPipeline<RawSocketContext>(builder =>
            {
                builder.Run(end =>
                {
                    Console.WriteLine(end.Header.IPDestaddr);
                    return Task.CompletedTask;
                });
            });
        }

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDefaultRawSocketProductEntry();
        }
    }
}
